package io.github.cisumer.wcfbin4j.nodes.attributes;

import java.io.IOException;
import java.io.InputStream;

import io.github.cisumer.wcfbin4j.NodeFactory;
import io.github.cisumer.wcfbin4j.nodes.AttributeRecord;
import io.github.cisumer.wcfbin4j.nodes.TextRecord;

/**
 * 使用Text类型作为value的Attribute
 * @author github.com/cisumer
 *
 */
public abstract class TextValueAttribute extends AttributeRecord<TextRecord<?>>{

	public TextRecord<?> parseValue(InputStream in)throws IOException {
		TextRecord<?> text= (TextRecord<?>) NodeFactory.createNode(in.read());
		text.parse(in);
		return text;
	}
	
	public String toValueXML(){
		return value.toXML();
	}
}
